package com.spring.student.register;

import com.spring.student.controller.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

public class Regjster { public static void main(String[] args) {
    ApplicationContext hong;
    hong = new ClassPathXmlApplicationContext("register.xml"); //resources内文件没有后缀
    User user = (User) hong.getBean("user");
    System.out.println("请学生进行账号注册");
    Scanner scan = new Scanner(System.in);
    System.out.println("请输入学号");
    String number = scan.next();
    System.out.println("请输入密码");
    String password = scan.next();
    user.setNumber(number);
    user.setPassword(password);
    System.out.println(user);

    System.out.println("这里区分线我也不知道怎么弄了----------------------");

    UserService userController = hong
            .getBean("userService",
                    UserService.class);
    System.out.println("请学生进行账号注册");
    Scanner scan1 = new Scanner(System.in);
    System.out.println("请输入学号");
    String number1 = scan.next();
    System.out.println("请输入密码");
    String password1 = scan.next();
    user.setNumber(number1);
    user.setPassword(password1);
    System.out.println(user);
}
}
